，方案一：Windows PowerShell 生成 RSA 密钥（推荐，兼容 Debian）

1. Windows 左下角搜索 **PowerShell**，右键以普通用户打开（不要管理员）
2. 粘贴这条命令（生成 PEM 格式 RSA4096，FinalShell 能识别）

ssh-keygen -m PEM -t rsa -b 4096 -C "debian-root@220.180.17.200"


交互提示：
- `Enter file in which to save the key`：直接回车，默认保存到 `C:\Users\你的用户名\.ssh\id_rsa`
- `Enter passphrase`：**强烈建议输入密钥口令**（保护私钥，每次用这个密钥登录要输入；可以留空回车免口令，但不安全）
- `Enter same passphrase again`：再次确认口令


✅ 生成完成后，在目录 `C:\Users\你的用户名\.ssh\` 得到 2 个文件：

- `id_rsa` → **私钥（导入 FinalShell，不要发给任何人）**
- `id_rsa.pub` → **公钥（复制里面全部内容，放到 Debian 服务器 root 的 authorized_keys）**

第二步：把公钥上传到 Debian 192.168.7.14（root）

mkdir -p /root/.ssh
chmod 700 /root/.ssh
# 粘贴 id_rsa.pub 的全部文本，粘贴完成后按 Ctrl+D 结束
cat >> /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys

第三步：修改 sshd 配置（和之前一样）

nano /etc/ssh/sshd_config

PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PermitRootLogin prohibit-password
# PasswordAuthentication yes 暂时保留yes，密钥测试成功后再改成no！

保存，重启 ssh 服务

systemctl restart ssh
systemctl status ssh



###########################################################
Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。

尝试新的跨平台 PowerShell https://aka.ms/pscore6

PS C:\Windows\system32>
PS C:\Windows\system32> ssh-keygen -m PEM -t rsa -b 4096 -C "debian-root@220.120.127.220"
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\Admin/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\Admin/.ssh/id_rsa
Your public key has been saved in C:\Users\Admin/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:N732eIgg4X6IWzh5W8RZd+MFBdAHB7YCBp答复QYBPxTTpg debian-root@220.120.127.220
The key's randomart image is:
+---[RSA 4096]----+
|   ..oo*ooo .o*=o|
|    . E +. . ..+.|
|     . +  . o +..|
|      +..o o + o |
|     . oS o . .  |
|     oo... . .   |
|    +ooo.. .o.   |
|    .+oo. ...o.  |
|    ....    ...  |
+----[SHA256]-----+
PS C:\Windows\system32>




